package file;

import java.io.File;
// 删除文件
public class DeleteFileDemo
{
    public static void main(String[] args)
    {
        File file = new File("test.txt");
        if (!file.exists())
        {
            System.out.println("......");
        }else
        {
            boolean delete = file.delete();
            if (delete)
            {
                System.out.println("delete successfully");
            }
            else
            {
                System.out.println("delete failed");
            }
        }
    }
}
